package rz.swing;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.imageio.stream.FileImageOutputStream;

public class PicTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		BufferedImage image = new BufferedImage(300, 300,
				BufferedImage.TYPE_INT_RGB);
		Graphics g = image.getGraphics();
		g.setColor(new Color(255, 255, 255));
		// g.fillRect(1, 1, width-1, height-1);
//		g.drawRoundRect(0, 0, 300, 300, 300, 300);
		g.drawOval(0, 0, 300, 300);
		g.drawOval(25, 25, 250, 250);
		g.drawOval(50, 50, 200, 200);
		// g.drawRect(0, 0, width-1, height-1);
		// g.setFont(mFont);
		g.drawString("Hello World", 150, 150);
		try {
			ImageIO.write(image, "JPEG", new FileImageOutputStream(new File("/home/ddh/aa.jpeg")));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
